In a data center network, sometimes a packet loss occurs in a switching network because of congestion. The packet loss in the switching network caused by congestion has the following two types: One type is a port conflict, and the other type is a downlink conflict. The port conflict includes scenarios in which, on a border of the switching network, when multiple flows are sent from a same egress port of a border switch that is directly connected to a terminal, a sum of traffic of multiple elephant flows exceeds a capacity of the port, thereby causing congestion. The downlink conflict includes scenarios in which multiple border switches in a network simultaneously send flows to a same core switch, where the core switch is configured to connect border switches in the network, and the flows are sent to a same destination border switch using the core switch; the core switch sends multiple elephant flows using a port connected to the destination border switch; and a sum of traffic of the multiple elephant flows exceeds a capacity of the port, thereby causing congestion because of aggregation of downlink traffic.
To avoid a packet loss, a border switch in the network performs load balancing on network traffic. A load balancing effect directly affects user experience. In a 3-stage Clos network, a generally used method is that, when sending a packet to a destination border switch, a source border switch selects a path with minimum load to send the packet to the destination border switch. For ease of description, in the following, a path between the source border switch and the core switch is referred to as an uplink, and a path between the core switch and the destination border switch is referred to as a downlink.
When the source border switch sends a packet to the destination border switch, a path tag (a field name: LBTag) and congestion extent (a field name: CE) are encapsulated in a Virtual Extensible Local Area Network (VXLAN) header in each packet. The LBTag is a port number used by the source border switch to send the packet, and the CE is used to represent a congestion metric value of a packet transmission path. In this example, a value of the CE is 0. After the packet passes through the core switch, the core switch updates a CE value of the packet to a congestion metric value of the downlink. After the packet is sent to the destination border switch, the destination border switch temporarily stores the congestion metric value of the downlink.
When sending a backward packet to the source border switch, the destination border switch encapsulates the temporarily stored congestion metric value of the downlink in feedback congestion metric (a field name: FB_Metric) in a large Layer-2 header and encapsulates an identifier of the destination border switch and a port number used by the destination border switch to send the backward packet in a feedback path tag (a field name: FB_LBTag) in the large Layer-2 header. In this way, the source border switch may determine a congestion status of the whole path according to a congestion value of the uplink of the source border switch and the congestion metric value of the downlink that is sent by the destination border switch, and further determine a path with minimum load from the source border switch to the destination border switch. However, the foregoing method is applicable to only a 3-stage Clos network, and is not applicable to a large scale deep-layer Clos network architecture.